/*******************************************************************************
        
        copyright:		Copyright (C) 2010. All Rights Reserved
        				
        license:		BSD style: $(LICENSE)
        		
        author(s): 		D implementation by Mike Reinhold and Phil DeMonaco
        				
*******************************************************************************/
module tango.util.cipher.order.NoOrdering;

import tango.util.cipher.Cipher;

/** Implementation of a no movement reordering */
class NoOrdering: BlockCipherOrdering {

	NoOrdering dup() {
		return new NoOrdering();
	}
	
	/*******************************************************************************
    
		    name
		    				
		    Returns:
		    the name of the block reordering implementation
	    				
	*******************************************************************************/
	string name() {
		return "Identity Ordering";
	}

	/*******************************************************************************
    
		    order
		    
		    Params:
		    pos = the block position to reorder
		    numBlocks = the total number of blocks in the text
		    				
		    Returns:
		    the new block position after reordering
					
	*******************************************************************************/
	uint order(uint pos, uint numBlocks) {
		return pos % numBlocks;
	}
}
